﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using Power.View.Dialog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Power.ViewModel.Dialog
{
    public class ChangePasswordViewModel: ViewModelBase
    {
        private ChangePassword model;
        public ChangePasswordViewModel(ChangePassword model)
        {
            this.model = model;
            Close = new RelayCommand(OnClose);
            CloseOK = new RelayCommand(OnCloseOK);
        }

        private void OnClose()
        {
            this.model.DialogResult = false;
            this.model.Close();
        }

        private void OnCloseOK()
        {
            var pdOld = this.model.pdOld.Text;
            var pd1 = this.model.pd1.Text;
            var pd2 = this.model.pd2.Text;

            this.model.DialogResult = true;
            this.model.Close();
        }

        #region 
        public RelayCommand Close { get; private set; }

        public RelayCommand CloseOK {  get; private set; }
        #endregion
    }
}
